/**
* 声音类
* BGM，语音，声效
*
*/


var soundeffect = function () {
	var bgm = new Audio(),
		voice = new Audio(),
		sound = new Audio(),
		// 读取bgm
		loadBgm = function (src) {
			bgm.src = src;
			bgm.load();
		},
		that = {
			// 读取声效
			loadSound: function(src) {
				sound.src = src;
				sound.load();
			},
			// 读取语音
			loadVoice: function(src) {
				voice.src = src;
				voice.load();
			},
			// 播放音乐
			playBgm: function(src) {
				//loadBgm(src);
				bgm.src = src;
				bgm.play();
			},
			// 停止音乐
			stopBgm: function () {
				if (!bgm.paused)
				bgm.pause();
			}
		}
	return that;
}